1677 return stack trace for authenticated users with specific roles#1683
1677 return stack trace for authenticated users with specific roles#1683
Conversation
… behavior and keeping it consistent
|
Something to note is that it returns JSON and a stack trace in JSON is not the prettiest of things with all the \n in the JSON string. The last commit shows an alternative where we could keep both, or pick one, of the options. Putting the traces in a list split by the newline (Could probably do \n\t too) does render nicely in the browser at least and possible in a fetch/output of a downstream client. Vs |
MikeNeilson
left a comment
There was a problem hiding this comment.
Instead of using System.getProperty or System.getenv directly, integrate into the Togglz feature system.
But otherwise I don't hate it. Do want to chew on it some more, but overall seems reasonable.
|
Spoke with Mike. Lets go with stackTraceLines and remove the string. Need to fix the OpenAPI spec. Latest Schema can break if Oracle out of sync (but check). But search for FAILED all caps and first instance all caps FAILED should have your error for the other failed tests. |


Add conditional stack traces for local and development debugging and keeps the existing
incidentIdentifierbehavior used for log discovery.Stack traces are now included in
CdaError.details.stackTracewhen the request isexplicitly configured for trace output:
OR
CWMS User AdminsAND indevenvironment (env.lower().includes('dev'))The implementation keeps
CdaErroras a response DTO and places the request-aware policyin
ErrorTraceSupport.To make that behavior apply consistently, this PR also removes several redundant
controller-level
catch (Exception)wrappers that were bypassingApiServlet, andupdates remaining endpoint
500handlers to make their responses throughErrorTraceSupport.Partly fixes some of
but not the ConnectionPreparingDataSource
Other potentially related issues include:
Trying to centralize general errors where possible and reduce fragmentation
Not trying to solve a new base exception direction, or a better inheritance model mainly because @MikeNeilson said to discuss more before doing that in another issue.